package org.example.mapper;

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.example.pojo.Orders;

import java.util.List;

/**
* @author wexx
* @description 针对表【tb_orders】的数据库操作Mapper
* @createDate 2024-11-15 15:41:43
* @Entity org.example.pojo.Orders
*/
public interface OrdersMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Orders record);

    int insertSelective(Orders record);

    Orders selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Orders record);

    int updateByPrimaryKey(Orders record);
    @Select("SELECT * FROM tb_orders WHERE user_id = #{id}")
    @Results({
            @Result(id= true, column="id", property="id"),
            @Result(column="number",property="number")
    })
    List<Orders> selectOrdersByUserId(int id);
}
